<?php 
namespace app\api\model\v1;

/**
* 设备sn
*/
class Sn extends Base
{
    public static function getIMEIByDeviceId($deviceId) {
		$dbTablePrefix = \think\Config::get('database.prefix');
        $result = self::query("select imei from ". $dbTablePrefix ."sn where id=(select sn_id from ". $dbTablePrefix ."device where id={$deviceId})");
        if (empty($result)) {
            return null;
        }
        return $result[0]['imei'];
    }
}